package com.xjtu.platform.security.updatePassword.dao;

import com.xjtu.platform.security.updatePassword.UpdatePasswordDto;
import com.xjtu.platform.security.updatePassword.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface UpdatePasswordDao {
    @Update("update user set user_pwd=#{dto.new_pwd} where user_id=#{user_id}")
    void updatePwd(@Param("dto") UpdatePasswordDto updatePasswordDto,@Param("user_id") String user_id);

    @Select("select email from user where user_id=#{user_id}")
    List<User> getEmail(String user_id);

    @Select("select flag from user where user_id=#{user_id}")
    int getFlag(String user_id);

    @Select("select time from cache where cache_id=#{user_id}")
    long getCachetime(String user_id);
}
